import { BasicFetchResult } from '/@/api/model/baseMode';
import { defHttp } from '/@/utils/http/axios';

import { ErrorMessageMode } from '/@/utils/http/axios/types';

enum Api {
  List = '/searchBox/findSearchBox',
  Update = '/searchBox/updateSearchBox',
}

/**
 * @description: 查询查看搜索栏状态
 */
export function ListApi(params, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicFetchResult<any>>(
    {
      url: Api.List,
      params,
    },
    {
      errorMessageMode: mode,
    }
  );
}

/**
 * @description: 设置搜索栏状态
 */
export function UpdateApi(params, mode: ErrorMessageMode = 'modal') {
  return defHttp.post(
    {
      url: Api.Update,
      params,
    },
    {
      errorMessageMode: mode,
    }
  );
}
